import { resources, Sprite, SpriteFrame } from "cc";

export default class LoaderUtils {
  public static loadResToSpriteFrame(path: string, sp: Sprite): void {
    resources.load(path + "/spriteFrame", SpriteFrame, (error, spriteFrame) => {
      if (error) {
        console.error("error->", path + "资源加载失败");
      } else {
        sp.spriteFrame = spriteFrame;
      }
    });
  }
}
